import request from '@/utils/request'
// 搜索
export const Search = (pageIndex, pageSize, name) =>
  request.get('/api/vm-service/vmType/search', {
    params: {
      pageIndex,
      pageSize,
      name
    }
  })
// 获取详情
export const GetList = (innerCode) =>
  request.get('/api/vm-service/channel/channelList/' + innerCode)
// 新增
export const AddSales = (vmType, nodeId, createUserId) =>
  request.post('/api/vm-service/vm', {
    data: {
      vmType,
      nodeId,
      createUserId
    }
  })
// 修改
export const ChangeSales = (id, nodeId) =>
  request.put('/api/vm-service/vm' + id + '/' + nodeId)
// 获取前十
export const GetTop = (businessId) =>
  request.get(' /api/vm-service/sku/businessTop10/' + businessId)
// 货道配置
// 应用策略
export const ApplyPolicy = (innerCodeList, policyId) =>
  request.put('/api/vm-service/vm/applyPolicy', {
    data: {
      innerCodeList,
      policyId
    }
  })
// 策略列表
export const PolicyList = (innerCodeList, policyId) =>
  request.get('/api/vm-service/policy', {
    params: {
      innerCodeList,
      policyId
    }
  })
// 搜索售货机(售货机列表)
export const GetSalesList = (pageIndex, pageSize, status, innerCode) =>
  request.get('/api/vm-service/vm/search', {
    params: {
      pageIndex,
      pageSize,
      status,
      innerCode
    }
  })
// 类型详情
export const GetSalesType = (typeId) =>
  request.get('/api/vm-service/vmType/' + typeId)
// 策略搜索
export const getSearch = (params) => {
  return request.get('/api/vm-service/policy/search', {
    params
  })
}
// 新增策略
export const addcelue = (data) => {
  return request({
    method: 'post',
    url: '/api/vm-service/policy',
    data
  })
}
// 删除 / 修改策略
export const deleteSearch = (id, params) => {
  return request({
    method: 'delete',
    url: '/api/vm-service/policy/' + id,
    params
  })
}
export const changeSearch = (id, data) => {
  return request({
    method: 'put',
    url: '/api/vm-service/policy/' + id,
    data
  })
}
// 查看详情
export const lookSearch = (id, params) => {
  return request({
    method: 'get',
    url: '/api/vm-service/policy/vmList/' + id,
    params
  })
}
// 订单管理
// 订单管理
// 订单管理
export const orderManagement = (params) => {
  return request({
    method: 'get',
    url: '/api/order-service/order/search',
    params
  })
}
// 对账管理
export const firstAxios = (params) => {
  return request({
    method: 'get',
    url: '/api/order-service/report/partnerCollect',
    params
  })
}

export const getHZS = (params) => {
  return request({
    method: 'get',
    url: '/api/user-service/partner/search',
    params
  })
}
// 獲得總數

export const getAllCount = (params) => {
  return request({
    method: 'get',
    url: '/api/order-service/report/orderCount',
    params
  })
}
// 获取一定时间范围之内的收入
export const getTimeAllCount = (params) => {
  return request({
    method: 'get',
    url: '/api/order-service/report/orderAmount',
    params
  })
}
// 獲取一定时间范围之内的分成总数
export const getTimeCount = (params) => {
  return request({
    method: 'get',
    url: '/api/order-service/report/totalBill',
    params
  })
}
